Technote 1098ATA Device Software Guide Additions and Corrections
By Brian Bechtel
|
CONTENTSErrors in the ATA Device Software Guide Device Config Structure in ATA 4.0 Detecting the Presence of the ATA Manager |
This Technote lists errors and additions to the ATA Device Software Guide We include both corrections to the original guide, as well as some minor additions for ATA Manager 4.0. ATA Manager 4.0 was introduced with the PowerBook 3400. This Note is directed at developers who wish to call the ATA Manager directly. Normally, applications would never call the ATA Manager directly; instead they use the the appropriate driver for the device in question. The ATA Manager is helpful for developers who are creating ATA device drivers, and for specialized applications which install such device drivers. |
Errors in the ATA Device Software GuideThroughout. All mentions of the ATA-2 standard should be updated. The ATA Manager supports ATA-3 devices as well. Page 4. The ATA disk driver usually has a driver
reference number of -54 (decimal) but may also have a different reference
number if -54 is taken when the driver is loaded. The driver name is
You should never rely on the driver reference number. Use the
Page 6. The The Page 9. The The Page 9. The The Page 11. The The Page 38. ATA_RegAccess The MgrVersion.majorRev = $04 MgrVersion.minorAndBugRev = $00 or $10 are versions which do NOT work. MgrVersion.majorRev = $04 MgrVersion.minorAndBugRev = $11 does work. Page 48. Device Config Structure in ATA 4.0Several of the fields of this structure are obsolete starting with ATA Manager 4.0. struct ATADevConfig { SInt32 ataConfigSetting; // <->: Configuration setting*/ UInt8 ataPIOSpeedMode; // <->: Device access speed in PIO Mode UInt8 reserved; // padding UInt16 atapcValid; // <->: Obsolete with ATA 4 UInt16 ataRWMultipleCount; // Reserved for future (not supported yet) UInt16 ataSectorsPerCylinder; // Reserved for future (not supported yet) UInt16 ataHeads; // Reserved for future (not supported yet) UInt16 ataSectorsPerTrack; // Reserved for future (not supported yet) UInt16 ataSocketNumber; // <--: (no longer supported with ATA 4) UInt8 ataSocketType; // <--: Specifies the socket type UInt8 ataDeviceType; // <--: Specifies the device type (get config only) UInt8 atapcAccessMode; // <->: Obsolete with ATA 4 UInt8 atapcVcc; // <->: Obsolete with ATA 4 UInt8 atapcVpp1; // <->: Obsolete with ATA 4 UInt8 atapcVpp2; // <->: Obsolete with ATA 4 UInt8 atapcStatus; // <->: Obsolete with ATA 4 UInt8 atapcPin; // <->: Obsolete with ATA 4 UInt8 atapcCopy; // <->: Obsolete with ATA 4 UInt8 atapcConfigIndex; // <->: Obsolete with ATA 4 UInt8 ataSingleDMASpeed; // <->: Single Word DMA Timing Class UInt8 ataMultiDMASpeed; // <->: Multiple Word DMA Timing Class UInt16 ataPIOCycleTime; // <->:Cycle time for PIO mode UInt16 ataMultiCycleTime; // <->:Cycle time for Multiword DMA mode UInt16 Reserved1[7]; // Reserved for future }; typedef struct ATADevConfig ATADevConfig;
Page 56. ATA_MgrInquiry In the |
History of the ATA ManagerATA Manager 4.0 vs ATA Manager 3.1
ATA Manager 4.0 is PowerPC
Native. ATA Manager 4.0 introduces the concept of the ATA Interface Module
or AIM, a plug-in hardware abstraction layer similar to the SIM of SCSI
Manager 4.3. The ATA Manager 3.1 vs. ATA Manager 3.0
The major change from version 3.0 to version 3.1
was the addition of bus-specific transfer timing information to function
Altered functions for ATA Manager 3.0 are:
The ATA Manager reports its overall data transfer
capabilities via the ATA Manager 3.0 vs. ATA Manager 2.0The major feature which was added to ATA Manager 3.0 was the support of DMA I/O operations to the device. No new functions were added to the interface, although several functions now accept or report DMA-specific information. Expanded functions for ATA Manager 3.0 are:
ATA Manager 2.0 vs ATA Manager 1.0The following list outlines several major features which were added in ATA Manager 2.0:
New functions were added and existing functions were expanded to support new features listed above. Consequently, different ataPBVers values may result in different responses for a given function. Refer to individual function for potential differences in response. New functions for ATA Manager 2.0 are:
Expanded functions for ATA Manager 2.0 are:
|
ATA Manager 4.0ATA Manager 4.0 is a redesign of the previous ATA Manager (v 3.1) undertaken in conjunction with the design of the PowerBook 3400. It is our expectation that every new CPU which supports ATA devices will use this new ATA Manager. The API between ATA Manager 4.0 and its clients (typically ATA and ATAPI disk device drivers) is a superset of ATA Manager 3.1. This allows old disk drivers to function correctly with the new ATA Manager. The ATA Manager prior to ATA 4.0 had knowledge about specific types of
ATA bus controllers. When a new CPU was developed which had a different ATA
bus controller, the ATA Manager needed to be revised. The ATA 4.0 design
contains a hardware abstraction layer called the ATA Interface
Module or AIM. This AIM is a native driver (ndrv), but it is not
called using the device manager. Instead, it has the driver option
The Operating System's Name Registry is used to contain all of the hardware specific information related to the ATA bus controller. The ATA Manager will use the Name Registry to locate and load the AIM, and the AIM will use CPU specific information stored in the Name Registry to do its initialization. For example, the base address of the ATA registers will be calculated by OpenFirmware or some other piece of system software and will be used by the AIM to talk to the ATA bus controller. There is currently no documentation available to external developers who wish to write an AIM. Such developers should contact Developer Support at devsupport@apple.com. Apple may work together with such developers to help develop appropriate documentation. ATA Manager 4.0 is PowerPC native. This manager still can be accessed using the 68K trap. If you wish to call the ATA manager on Power PC equipped machines, you need to supply some Mixed Mode glue to call the ataManager trap. The following will work #include <MixedMode.h>#include <ATA.h> #define RESULT_OFFSET(type) \ ((sizeof(type) == 1) ? 3 : ((sizeof(type) == 2) ? 1 : 0)) #define TBTrapTableAddress(trapNum) (((trapNum & 0x03FF) << 2) + 0xE00) pascal SInt16 ataManager(ataPB *pb) { #ifdef applec #if sizeof(SInt16) > 4 #error "Result types larger than 4 bytes are not supported." #endif #endif long private_result; private_result = CallUniversalProc( *(UniversalProcPtr*)TBTrapTableAddress(0xAAF1), kPascalStackBased | RESULT_SIZE(SIZE_CODE(sizeof(SInt16))) | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(pb))), pb); return *(((SInt16*)&private_result) + RESULT_OFFSET(SInt16)); } |
Additional Event DocumentationThe following events were not well documented in ATA Device Software Guide.
Note also that the |
Obsolete ResourcesThe following are some other places where the ATA Manager has been documented. These documents should be considered obsolete. They are replaced by the ATA Device Software Guide and this technote.
Q&A DV 24, ATA Manager Events Clarified has some additional ATA events. These events are incorporated in this document. This Q&A is incorporated in this document. The Q&A should be considered obsolete. Q&A DV 26, Calling ataManager on a Power Macintosh demonstrates how to call the ATA Manager from PowerPC code. This Q&A is incorporated in this document. The Q&A should be considered obsolete. The Q&As of develop issue 26 have some additional documentation of some ATA events. These are the same events discussed in Q&A DV 24, ATA Manager Events Clarified These events are incorporated in this document. The develop Journal Q&As should be considered obsolete. Valid Resources
|
SummaryATA Manager 4.0 is a superset of ATA Manager 3.0, documented in the ATA Device Software Guide. There are some minor errors in that document. We welcome any additions or corrections to this technote or the ATA Device Software Guide; please send such comments to devsupport@apple.com. |
Some of the following documents may be available from ftp://fission.dt.wdc.com/x3t13/ x3t13.html or ftp://ftp.symbios.com/pub/standard s/io
|
Thanks to Rhoads Hollowell, Kevin Snow, Steve Schwander, Allen Watson, Michael Hinkson, Mike Duigou, and Vinnie Moscaritolo. |
Tech Support
Technotes
Previous Technote |
Next Technote |
Contents
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help